package com.annet.token.model;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.*;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;
import java.util.Date;

/**
 * 服务配置设置
 *
 * @author dingjb
 * @date 2020/12/31
 */
@Builder
@Data
@EqualsAndHashCode(callSuper = false)
@Entity
@DynamicInsert
@DynamicUpdate
@EntityListeners(AuditingEntityListener.class)
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "server_setting")
public class ServerSetting  {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    @LastModifiedDate
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", locale = "zh", timezone = "GMT+8")
    private Date modifyDate;

    @CreatedDate
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", locale = "zh", timezone = "GMT+8")
    private Date createTime;

    // 是否废弃（1是，0、null否）
    @JsonIgnore
    private Integer isDiscard = 0;

    // 医院唯一编号
    @Column(unique = true, nullable = false)
    private String orgCode;
    // 名称
    private String name;
    // 用户名
    private String uname;
    // 密码
    private String pwd;
    //密钥
    private String secretKey;
    //限制ip XX.XX.XX,xx.xx.xx 多个ip用,号分割
    private String enableIps;

    private String unableIps;

}
